// Plane.h
//
//////////////////////////////////////////////////////////////////////

#ifndef _PLANE_H
#define _PLANE_H

#include "Lib3D.h"
#include "Matrix3D.h"

class Plane{
public:
	Plane();
	Plane(Vector3D A, Vector3D B, Vector3D C);

	void SetNandD(Vector3D n, float d);
	void CalcCoeffs(Vector3D A, Vector3D B, Vector3D C);
	void CalcCoeffsGivenNormal(Vector3D Normal, Vector3D PtOnPlane);
	float DistToPt(Vector3D P) const;
	int InOutTest(Vector3D P) const;
	int RayIntersection(Vector3D Start, Vector3D Dir, Vector3D& HitPt) const;
	int EdgeIntersection(Vector3D A, Vector3D B, Vector3D &HitPt) const;
public:
	Vector3D N; 
	float D;  
};
#endif

